<!DOCTYPE html>
<html lang="zn" xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <head>
        <base th:href="@{/}"/>
        <meta charset="utf-8">
        <title>中俄贸易供需服务平台管理系统</title>
        <meta http-equiv="Cache-Control" content="no-cache"/>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="static/css/x-admin.css" media="all">
        <script src="static/js/jquery.min.js" ></script>
         <script>
	 		//刷新时间,刷session 防止网页过期
	 		function refreshPage()
	 		{
	 			$.ajax({
	 				url:"admin/refreshSession",
	 				cache:false
	 			});
	 		}
             //不是超级管理员,不显示 系统权限管理这个导航
             $(function(){
                 //这个定时器的作用是防止session过期
    	         setInterval("refreshPage()", 6*1000*20);  //每20分钟
                 $.get("getSession",function(data){
                     let roleName=data.t.roles.roleName
                     alert(roleName)
                    alert(JSON.stringify(data))
                     // alert(data.t.username)
                     $("#roleName").html(data.t.username)
                     // if(roleName=="user"||roleName=="vistor"){
                     //      $("#li_system_power").hide();
                     //     }
                     $("#roleName").html()
                 })
                 $.ajax({
                     url:"getSession",
                     dataType:"json",
                     success:function(data){
                         var t=data.t
                         if(t==null||t.id==0){
                             window.location.href = "login";
                         }else {
                             $.ajax({
                                 url: "admin/getSessionAdmin",
                                 dataType: "json",
                                 success: function (data) {
                                     alert(JSON.stringify(data))
                                     if (data == null || data.t.id == 0) {
                                         window.location.href = "login";
                                     } else {
                                         let authList = data.t;
                                         alert(authList.length);
                                         //遍历权限
                                         for (i = 0; i < authList.length; i++) {
                                             let path = authList[i].path
                                             let label = authList[i].authLabel;
                                             // alert(label)
                                             // alert(path)
                                             $("#" + label).attr("_href", function (i, o) {
                                                 return path;
                                             });
                                             $("#" + label).show()
                                         }

                                     }
                                 },
                                 error: function () {
                                 }
                             });
                         }
                     }
                 })
             });
                function openNewWin(url)
                {
                    window.open(url);
                }

             function logout(){
            	 if(confirm("是否退出？")){
            		 $.ajax({
                		 url:"admin/logout",
                		 type:"get",
                		 success:function(result){
                		     alert(JSON.stringify(result.message))
                			 if(result.message=="success"){
                			     alert("haha")
                				 window.location.href="login"
                			 }
                		 }
                	 });
            	 }
             }
            function zhuxiao(){
                if(confirm("是否注销？")){
                    $.ajax({
                        url:"admin/zhuxiao",
                        type:"get",
                        success:function(result){
                            if(result.message=="success"){
                                alert("注销成功")
                                window.location.href="login";
                            }else{
                                alert("注销失败")
                            }
                        }
                    });
                }

            }
         </script>
    </head>
    <body>
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header header header-demo" >
                <div class="layui-main" >
                	<div>
	                    <span >平台管理系统</span>
	                    <a class="logo" href="./index.html">                    
	                   		<img src="static/images/0.png" width="275px" height="38px"></img>
	                    </a>
                    </div>
                    <ul class="layui-nav" lay-filter="" id="ulicon">
                      
                      <li class="layui-nav-item" id="liicon">
                        <a href="javascript:;" >当前登陆：<span id="roleName" style="font-size:14px"></span></a>                      
                      </li>                   
                      <li class="layui-nav-item x-index" id="liicon">
                      		<a title="处理" href="javascript:;" onclick="updatePwd('修改密码','updatepwd','4','','350')"
				            class="ml-5" style="text-decoration:none">修改密码</a></li>
                      <li class="layui-nav-item x-index" id="liicon"><a href="javascript:void(0);" onclick="logout();">退出登陆</a></li>
                      <li class="layui-nav-item x-index" id="liicon"><a href="javascript:void(0);" onclick="zhuxiao();">注销账号</a></li>
                      <li class="layui-nav-item x-index" id="liicon">
                          <a href ="http://114.55.145.59/rctms/" class="ml-5" target="_blank">前台首页</a></li>
                    </ul>
                </div>
            </div>
            <div class="layui-side layui-bg-black x-side">
                <div class="layui-side-scroll">
                    <ul  class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side" id="ulList">
                    <!--VIP企业管理-->
                        <li class="layui-nav-item" id="li_vip_company_power"style="display: none">
                            <a class="javascript:;"  href="javascript:;" _href="page/vip">
                              <cite>VIP企业管理</cite>
                            </a>
                     
                        </li>
                        <!--普通企业管理-->
                        <li class="layui-nav-item" id="li_company_power" style="display: none">
                            <a class="javascript:;" href="javascript:;"_href="page/company">
                               <cite>普通企业管理</cite>
                            </a>
                        </li>
                        <!--国际采购管理-->
                        <li class="layui-nav-item" id="li_purchase_power" style="display: none">
                            <a class="javascript:;" href="javascript:;" _href="page/procurement">
                                <cite>国际采购管理</cite>
                            </a>
                        </li>
                         <!--国际供应管理-->
                         <li class="layui-nav-item" id="li_supply_power" style="display: none">
                            <a class="javascript:;" href="javascript:;" _href="page/supply">
                                <cite>国际供应管理</cite>
                            </a>
                        </li>
                         <!--国际物流管理-->
                         <li class="layui-nav-item" id="li_logistics_power">
                            <a class="javascript:;" href="javascript:;" _href="page/logistics">
                               <cite>国际物流管理</cite>
                            </a>
                        </li>
                        <!--新闻资讯管理-->
                        <li class="layui-nav-item" id="li_news_power" style="display: none">
                            <a class="javascript:;" href="javascript:;">
                                <cite>新闻资讯管理</cite>
                            </a>
                            <dl class="layui-nav-child">
                                <dd class="">
                                    <dd class="">
                                        <a href="javascript:;" _href="page/news">
                                            <i class="layui-icon"></i><cite>新闻资讯</cite>
                                        </a>
                                    </dd>
                                </dd>
                                <dd class="">
                                    <dd class="">
                                        <a href="javascript:;" _href="page/assistant">
                                            <i class="layui-icon"></i><cite>外贸助手</cite>
                                        </a>
                                    </dd>
                                </dd>
                              
                            </dl>
                        </li>
                           <!--关于我们-->
                           <li class="layui-nav-item" id="li_about_us_power" style="display:none">
                            <a class="javascript:;" href="javascript:;" _href="about.html">                                
                               <cite>关于我们</cite>
                            </a>
                        </li>
                          <!--首页管理-->
                          <li class="layui-nav-item" id="li_index_power" style="display: none">
                            <a class="javascript:;" href="javascript:;" _href="administration.html">
                               <cite>首页管理</cite>
                            </a>
                        </li>
                          <!--统计分析-->
                          <li class="layui-nav-item" id="li_statistics_power" style="display:none">
                            <a class="javascript:;" href="javascript:;" _href="page/Statistics">
                               <cite>统计分析</cite>
                            </a>
                        </li>
     
                         <li class="layui-nav-item" id="li_system_power" style="display:none">
                            <a class="javascript:;" href="javascript:;">
                                <cite>系统权限管理</cite>
                            </a>
                            <dl class="layui-nav-child">
                                <dd class="">
                                    <dd class="">
                                        <a  href="javascript:;" id="system_user" _href="admin/system"style="display:none">
                                            <i class="layui-icon"  href="javascript:;" ></i><cite>用户维护</cite>
                                        </a>
                                    </dd>
                                <dd class="">
                                    <a href="javascript:;" id="system_role"  _href="admin/role"style="display:none">
                                        <i class="layui-icon" href="javascript:;" ></i><cite>角色维护</cite>
                                    </a>
                                </dd>
                                <dd class="">
                                    <a href="javascript:;"  id="system_auth"  _href="admin/auth" style="display:none">
                                        <i class="layui-icon" href="javascript:;"></i><cite>模块维护</cite>
                                    </a>
                                </dd>
                                </dd>
                                <dd class="">
                                    <dd class="">
                                        <a href="javascript:;" id="system_log" _href="page/log" style="display:none">
                                            <i class="layui-icon"></i><cite>系统操作日志</cite>
                                        </a>
                                    </dd>
                                </dd>
                              
                            </dl>
                        </li>
                        
                        
                    </ul>
                </div>

            </div>
            <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true">
                <div class="x-slide_left"></div>
                <ul class="layui-tab-title">
                    <li class="layui-this">
                        VIP数据管理
                        <i class="layui-icon layui-unselect layui-tab-close">ဆ</i>
                    </li>
                </ul>
                <div class="layui-tab-content site-demo site-demo-body">
                    <div class="layui-tab-item layui-show">
                        <iframe frameborder="0" src="page/vip" class="x-iframe"></iframe>
                    </div>
                </div>
            </div>
            <div class="site-mobile-shade">
            </div>
        </div>
        <script src="static/lib/layui/layui.js" charset="utf-8"></script>
        <script src="static/js/x-admin.js"></script>
        <script src="static/js/x-layui.js" charset="utf-8"></script>
        <script>
            var _hmt = _hmt || [];
            (function() {
              var hm = document.createElement("script");
              var s = document.getElementsByTagName("script")[0]; 
              s.parentNode.insertBefore(hm, s);
            })();
            
            layui.use(['form'], function(){                      
	            form = layui.form();//弹出层	  
	        })
            // 修改
            function updatePwd(title,url,id,w,h) {
                x_admin_show(title,url,w,h); 
            }  
           </script>
      
    </body>
</html>